//
//  ErrorCode.m
//  HeFanTV
//
//  Created by libingbing on 2017/6/21.
//  Copyright © 2017年 SAGA. All rights reserved.
//

#import "ErrorCode.h"
#import "HFStatusView.h"

@implementation ErrorCode

+(void)netRequestServerSuccesWithErrCode:(id _Nullable) result{
    
    NSInteger code = [result[@"code"] integerValue];
    switch (code) {
        case 1000:
            break;
            
        default:
            break;
    }
}

+(void)netRequestServerFailedWithErrCode:(NSError * _Nonnull) error {
    
    NSInteger code= error.code;
    switch (code) {
        case -1009:
            [HFStatusView showMessageWithTitle:kLocalizedString(@"网络未连接",nil) type:HFStatusType_Success statusBarHidden:NO];
            break;
        case -1001:
            [HFStatusView showMessageWithTitle:kLocalizedString(@"网络不给力，请稍后再试",nil) type:HFStatusType_Success statusBarHidden:NO];
            break;
        case -1004:
            [HFStatusView showMessageWithTitle:kLocalizedString(@"连接超时",nil) type:HFStatusType_Success statusBarHidden:NO];
            break;

        default:
            break;
    }
}

@end
